import Vue from 'vue';
import App from './App.vue';
import { initRouter } from './router';

import './theme/index.less';
import './theme/base.less';
import Antd from 'ant-design-vue';
import Viser from 'viser-vue';
// import '@/mock';
import store from './store';
import 'animate.css/source/animate.css';
import Plugins from '@/plugins';
import { initI18n } from '@/utils/i18n';
import bootstrap from '@/bootstrap';
import * as echarts from 'echarts';
Vue.prototype.$echarts = echarts;
import print from '@/utils/print';
Vue.use(print);
import moment from 'moment';
import 'moment/locale/zh-cn';

import momentDurationFormatSetup from 'moment-duration-format';
momentDurationFormatSetup(moment);

Vue.prototype.$moment = moment;

import { number_format } from '@/utils/util';
Vue.prototype.$numberFormat = number_format;

import NP from 'number-precision';
NP.enableBoundaryChecking(false);
Vue.prototype.$np = NP;
Vue.prototype.$clientWidth = document.body.clientWidth;

const router = initRouter(store.state.setting.asyncRoutes);

const i18n = initI18n('CN', 'US');

import 'xe-utils';
import VXETable from 'vxe-table';
import 'vxe-table/lib/style.css';

window.cusRouter = router;

Vue.use(Antd);
Vue.config.productionTip = false;
Vue.use(Viser);
Vue.use(Plugins);
Vue.use(VXETable);

// 故障级别icon
import priorityIcon from '@/pages/components/priorityIcon';
import noticePriorityIcon from '@/pages/components/noticePriorityIcon';

Vue.component('priorityIcon', priorityIcon);
Vue.component('noticePriorityIcon', noticePriorityIcon);
import '@/utils/tools.js';
import './theme/reset.less';

import '@/utils/pres.js';

bootstrap({ router, store, i18n, message: Vue.prototype.$message });
Vue.prototype.$bus = new Vue()
new Vue({
  router,
  store,
  i18n,
  render: h => h(App)
}).$mount('#app');
